#define  _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>
#include<string.h>
#include<assert.h>

void* my_memmove(void* dest, const void* source, size_t num)
{
	assert(dest && source);
	void* ret = dest;
	if (dest < source) {
		while (num--) {
			*(char*)dest = *(char*)source;
			dest = (char*)dest + 1;
			source = (char*)source + 1;
		}
	}
	else {
		while (num--) {
			
			*((char*)dest + num) = *((char*)source + num);
		}
	}
	return ret;
}

void test1()
{
	int arr[10] = {1,2,3,4,5,6,7,8,9,10};
	my_memmove(arr+3, arr, 20);
}
int main()
{
	test1();
	//test2();
	return 0;
}